	PROGRAM WORLD
C *** LAST REVISED ON 14-AUG-1987 16:14:57.40
C *** SOURCE FILE: [DL.GRAPHICS.LONGLIB]WORLD.FOR
C
C	AND EXAMPLE OF USING THE MAPLIB ROUTINES.
C	THIS PROGRAM WILL PLOT A 3-D MAP OF THE WORLD WITH
C	BINNING GRID INFORMATION ON IT.
C
	DIMENSION V(3)
C
C	DEFINE DEGREE TO RADIAN CONVERSION
C
	DEGRAD(X)=X*3.141592654/180.0
C
	R=6378.1778		! RADIUS OF THE EARTH IN KM
	FLAT=3.3528132E-3	! FLATNESS OF EARTH
	F3=0.00002		! 3D SCALE FACTOR
	F=5.0			! PLOTTING SCALE FACTOR
	X=100.			! VIEW POINT LOCATION
	Y=100.
	Z=100.
	DS=600.			! PERSPECTIVE FACTOR
	RES=20.			! LAT/LONG GRID RESOLUTION
C
	NPTS=180./RES
	FPTS=NPTS
C
C	OPEN LONGLIB PACKAGE WITH PROMPT FOR SCREEN DEVICE
C
	CALL FRAME(3,0,5.,5.,F)
C
C	INITIALIZE 3D ROUTINES
C
	CALL INIT3D(X,Y,Z,0.,0.,0.,0.,DS,F3)
C
C	PLOT A 2D LABEL (DOESN'T USE 3D ROUTINES)
C
	CALL SYMBOL(-.5,-.5,.03,'WORLD',0.,5,-1)
C
C	PLOT EARTH LAT/LONG GRID IN 3D
C
	CALL NEWPEN(3)
	DO 310 ILAT=2,NPTS
		ALAT=DEGRAD((ILAT-1)*180./FPTS)
		ID=3
		DO 310 ILONG=1,2*NPTS+1
			ALONG=DEGRAD((ILONG-1)*180./FPTS)
			RAD=R*(1.-FLAT*SIN(ALAT))
			CALL SPRECT1(V,ALONG,ALAT,RAD)
			CALL PLOT3D(V(1),V(2),V(3),ID)
			ID=2
310	CONTINUE
	CALL NEWPEN(5)
	DO 320 ILONG=1,NPTS*2+1
		ALONG=DEGRAD((ILONG-1)*180./FPTS)
		ID=3
		DO 320 ILAT=1,NPTS+1
			ALAT=DEGRAD((ILAT-1)*180./FPTS)
			RAD=R*(1.-FLAT*SIN(ALAT))
			CALL SPRECT1(V,ALONG,ALAT,RAD)
			CALL PLOT3D(V(1),V(2),V(3),ID)
			ID=2
320	CONTINUE
	CALL PLOT(0.,0.,3)
C
C	ADD LAND MAP
C
	CALL NEWPEN(0)
	CALL EARTH3D(R,FLAT)
	CALL PLOTND
	CALL CTERM(2)
	STOP
	END
